function [Jx_f, Jy_f]= WideSlope2(Jx, Jy,J_sign,XL,YL,current)
    N=2;
    x=zeros(1,N);
    y=zeros(1,N);
    x(1)=1;
    y(1)=100+randi(800);
    
    w=50+randi(30);

    x(N)=XL;
    y(N)=100+randi(800);
    
    xg=1:XL;
    yg=(interpn(x,y,xg));
    
    w=50+randi(30);

    for i=w+2:length(xg)-w-2
        ms=abs((yg(i-1)-yg(i))/(xg(i-1)-xg(i)));
        if yg(i-1)<yg(i)
            Jx(round(yg(i-1))-w:round(yg(i))+w,xg(i-1)-w:xg(i)+w)=J_sign*sqrt(1/(1+ms^2))*current;
            Jy(round(yg(i-1))-w:round(yg(i))+w,xg(i-1)-w:xg(i)+w)=J_sign*sqrt(1/(1+1/ms^2))*current;
        else
            Jx(round(yg(i))-w:round(yg(i-1))+w,xg(i-1)-w:xg(i)+w)=J_sign*sqrt(1/(1+ms^2))*current;
            Jy(round(yg(i))-w:round(yg(i-1))+w,xg(i-1)-w:xg(i)+w)=J_sign*sqrt(1/(1+1/ms^2))*-current;
        end
    end

    Jx_f=imgaussfilt(Jx,w/10);
    Jy_f=imgaussfilt(Jy,w/10);
end